package itheima.lianxi4;

import java.util.Random;

public class Test {
    public static void main(String[] args) {
        int[] arr1 = new int[5];
        int[] arr2 = new int[2];

        int count1 = 0;
        int count2 = 0;
        Random r = new Random();
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = r.nextInt(9) + 1;
            System.out.println(arr1[i]);
            if (arr1[i] % 2 == 0){
                count1++;
            }
            if (arr1[i] % 3 == 0){
                count2++;
            }
        }
        arr2[0] = count1;
        arr2[1] = count2;
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }
}
